home *** CD-ROM | disk | FTP | other *** search
/ Inter.Net 55-1 / Inter.Net 55-1.iso / CBuilder / Setup / BCB / data.z / aclapi.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-02-09  |  14.0 KB  |  443 lines

  1. //+-------------------------------------------------------------------
  2. //
  3. //  Microsoft Windows
  4. //  Copyright (C) Microsoft Corporation, 1993-1996.
  5. //
  6. //  File:        aclapi.h
  7. //
  8. //  Contents:    public header file for acl and trusted server access control
  9. //               APIs
  10. //
  11. //--------------------------------------------------------------------
  12.  
  13. /*
  14.  *      C/C++ Run Time Library - Version 9.0
  15.  *
  16.  *      Copyright (c) 1997, 1998 by Borland International
  17.  *      All Rights Reserved.
  18.  *
  19.  */
  20.  
  21. #ifndef __ACCESS_CONTROL_API__
  22. #define __ACCESS_CONTROL_API__
  23. #pragma option push -b
  24.  
  25. #include <windows.h>
  26. #include <accctrl.h>
  27.  
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31.  
  32. DWORD
  33. WINAPI
  34. SetEntriesInAclW( IN  ULONG               cCountOfExplicitEntries,
  35.                   IN  PEXPLICIT_ACCESS_W  pListOfExplicitEntries,
  36.                   IN  PACL                OldAcl,
  37.                   OUT PACL              * NewAcl);
  38.  
  39. DWORD
  40. WINAPI
  41. SetEntriesInAclA( IN  ULONG               cCountOfExplicitEntries,
  42.                   IN  PEXPLICIT_ACCESS_A  pListOfExplicitEntries,
  43.                   IN  PACL                OldAcl,
  44.                   OUT PACL              * NewAcl);
  45.  
  46. #ifdef UNICODE
  47.     #define SetEntriesInAcl     SetEntriesInAclW
  48. #else
  49.     #define SetEntriesInAcl     SetEntriesInAclA
  50. #endif
  51.  
  52.  
  53. DWORD
  54. WINAPI
  55. GetExplicitEntriesFromAclW( IN  PACL                  pacl,
  56.                             OUT PULONG                pcCountOfExplicitEntries,
  57.                             OUT PEXPLICIT_ACCESS_W  * pListOfExplicitEntries);
  58.  
  59. DWORD
  60. WINAPI
  61. GetExplicitEntriesFromAclA( IN  PACL                  pacl,
  62.                             OUT PULONG                pcCountOfExplicitEntries,
  63.                             OUT PEXPLICIT_ACCESS_A  * pListOfExplicitEntries);
  64.  
  65. #ifdef UNICODE
  66.     #define GetExplicitEntriesFromAcl       GetExplicitEntriesFromAclW
  67. #else
  68.     #define GetExplicitEntriesFromAcl       GetExplicitEntriesFromAclA
  69. #endif
  70.  
  71.  
  72. DWORD
  73. WINAPI
  74. GetEffectiveRightsFromAclW( IN  PACL          pacl,
  75.                             IN  PTRUSTEE_W    pTrustee,
  76.                             OUT PACCESS_MASK  pAccessRights);
  77.  
  78. DWORD
  79. WINAPI
  80. GetEffectiveRightsFromAclA( IN  PACL          pacl,
  81.                             IN  PTRUSTEE_A    pTrustee,
  82.                             OUT PACCESS_MASK  pAccessRights);
  83.  
  84. #ifdef UNICODE
  85.     #define GetEffectiveRightsFromAcl       GetEffectiveRightsFromAclW
  86. #else
  87.     #define GetEffectiveRightsFromAcl       GetEffectiveRightsFromAclA
  88. #endif
  89.  
  90.  
  91. DWORD
  92. WINAPI
  93. GetAuditedPermissionsFromAclW( IN  PACL          pacl,
  94.                                IN  PTRUSTEE_W    pTrustee,
  95.                                OUT PACCESS_MASK  pSuccessfulAuditedRights,
  96.                                OUT PACCESS_MASK  pFailedAuditRights);
  97.  
  98. DWORD
  99. WINAPI
  100. GetAuditedPermissionsFromAclA( IN  PACL          pacl,
  101.                                IN  PTRUSTEE_A    pTrustee,
  102.                                OUT PACCESS_MASK  pSuccessfulAuditedRights,
  103.                                OUT PACCESS_MASK  pFailedAuditRights);
  104.  
  105. #ifdef UNICODE
  106.     #define GetAuditedPermissionsFromAcl    GetAuditedPermissionsFromAclW
  107. #else
  108.     #define GetAuditedPermissionsFromAcl    GetAuditedPermissionsFromAclA
  109. #endif
  110.  
  111.  
  112.  
  113. DWORD
  114. WINAPI
  115. GetNamedSecurityInfoW( IN  LPWSTR                 pObjectName,
  116.                        IN  SE_OBJECT_TYPE         ObjectType,
  117.                        IN  SECURITY_INFORMATION   SecurityInfo,
  118.                        OUT PSID                 * ppsidOowner,
  119.                        OUT PSID                 * ppsidGroup,
  120.                        OUT PACL                 * ppDacl,
  121.                        OUT PACL                 * ppSacl,
  122.                        OUT PSECURITY_DESCRIPTOR * ppSecurityDescriptor);
  123.  
  124. DWORD
  125. WINAPI
  126. GetNamedSecurityInfoA( IN  LPSTR                  pObjectName,
  127.                        IN  SE_OBJECT_TYPE         ObjectType,
  128.                        IN  SECURITY_INFORMATION   SecurityInfo,
  129.                        OUT PSID                 * ppsidOowner,
  130.                        OUT PSID                 * ppsidGroup,
  131.                        OUT PACL                 * ppDacl,
  132.                        OUT PACL                 * ppSacl,
  133.                        OUT PSECURITY_DESCRIPTOR * ppSecurityDescriptor);
  134.  
  135. #ifdef UNICODE
  136.     #define GetNamedSecurityInfo        GetNamedSecurityInfoW
  137. #else
  138.     #define GetNamedSecurityInfo        GetNamedSecurityInfoA
  139. #endif
  140.  
  141.  
  142. DWORD
  143. WINAPI
  144. GetSecurityInfo( IN  HANDLE                 handle,
  145.                  IN  SE_OBJECT_TYPE         ObjectType,
  146.                  IN  SECURITY_INFORMATION   SecurityInfo,
  147.                  OUT PSID                 * ppsidOowner,
  148.                  OUT PSID                 * ppsidGroup,
  149.                  OUT PACL                 * ppDacl,
  150.                  OUT PACL                 * ppSacl,
  151.                  OUT PSECURITY_DESCRIPTOR * ppSecurityDescriptor);
  152.  
  153.  
  154. DWORD
  155. WINAPI
  156. SetNamedSecurityInfoW( IN LPWSTR                pObjectName,
  157.                        IN SE_OBJECT_TYPE        ObjectType,
  158.                        IN SECURITY_INFORMATION  SecurityInfo,
  159.                        IN PSID                  psidOowner,
  160.                        IN PSID                  psidGroup,
  161.                        IN PACL                  pDacl,
  162.                        IN PACL                  pSacl);
  163.  
  164. DWORD
  165. WINAPI
  166. SetNamedSecurityInfoA( IN LPSTR                 pObjectName,
  167.                        IN SE_OBJECT_TYPE        ObjectType,
  168.                        IN SECURITY_INFORMATION  SecurityInfo,
  169.                        IN PSID                  psidOowner,
  170.                        IN PSID                  psidGroup,
  171.                        IN PACL                  pDacl,
  172.                        IN PACL                  pSacl);
  173.  
  174. #ifdef UNICODE
  175.     #define SetNamedSecurityInfo        SetNamedSecurityInfoW
  176. #else
  177.     #define SetNamedSecurityInfo        SetNamedSecurityInfoA
  178. #endif
  179.  
  180.  
  181. DWORD
  182. WINAPI
  183. SetSecurityInfo( IN HANDLE                handle,
  184.                  IN SE_OBJECT_TYPE        ObjectType,
  185.                  IN SECURITY_INFORMATION  SecurityInfo,
  186.                  IN PSID                  psidOowner,
  187.                  IN PSID                  psidGroup,
  188.                  IN PACL                  pDacl,
  189.                  IN PACL                  pSacl);
  190.  
  191.  
  192. //----------------------------------------------------------------------------
  193. // The following API are provided for trusted servers to use to
  194. // implement access control on their own objects.
  195. //----------------------------------------------------------------------------
  196.  
  197. DWORD
  198. WINAPI
  199. BuildSecurityDescriptorW( IN  PTRUSTEE_W              pOwner,
  200.                           IN  PTRUSTEE_W              pGroup,
  201.                           IN  ULONG                   cCountOfAccessEntries,
  202.                           IN  PEXPLICIT_ACCESS_W      pListOfAccessEntries,
  203.                           IN  ULONG                   cCountOfAuditEntries,
  204.                           IN  PEXPLICIT_ACCESS_W      pListOfAuditEntries,
  205.                           IN  PSECURITY_DESCRIPTOR    pOldSD,
  206.                           OUT PULONG                  pSizeNewSD,
  207.                           OUT PSECURITY_DESCRIPTOR  * pNewSD);
  208.  
  209. DWORD
  210. WINAPI
  211. BuildSecurityDescriptorA( IN  PTRUSTEE_A              pOwner,
  212.                           IN  PTRUSTEE_A              pGroup,
  213.                           IN  ULONG                   cCountOfAccessEntries,
  214.                           IN  PEXPLICIT_ACCESS_A      pListOfAccessEntries,
  215.                           IN  ULONG                   cCountOfAuditEntries,
  216.                           IN  PEXPLICIT_ACCESS_A      pListOfAuditEntries,
  217.                           IN  PSECURITY_DESCRIPTOR    pOldSD,
  218.                           OUT PULONG                  pSizeNewSD,
  219.                           OUT PSECURITY_DESCRIPTOR  * pNewSD);
  220.  
  221.  
  222. #ifdef UNICODE
  223.     #define BuildSecurityDescriptor     BuildSecurityDescriptorW
  224. #else
  225.     #define BuildSecurityDescriptor     BuildSecurityDescriptorA
  226. #endif
  227.  
  228.  
  229. DWORD
  230. WINAPI
  231. LookupSecurityDescriptorPartsW( OUT PTRUSTEE_W         * pOwner,
  232.                                 OUT PTRUSTEE_W         * pGroup,
  233.                                 OUT PULONG               cCountOfAccessEntries,
  234.                                 OUT PEXPLICIT_ACCESS_W * pListOfAccessEntries,
  235.                                 OUT PULONG               cCountOfAuditEntries,
  236.                                 OUT PEXPLICIT_ACCESS_W * pListOfAuditEntries,
  237.                                 IN  PSECURITY_DESCRIPTOR pSD);
  238.  
  239. DWORD
  240. WINAPI
  241. LookupSecurityDescriptorPartsA( OUT PTRUSTEE_A         * pOwner,
  242.                                 OUT PTRUSTEE_A         * pGroup,
  243.                                 OUT PULONG               cCountOfAccessEntries,
  244.                                 OUT PEXPLICIT_ACCESS_A * pListOfAccessEntries,
  245.                                 OUT PULONG               cCountOfAuditEntries,
  246.                                 OUT PEXPLICIT_ACCESS_A * pListOfAuditEntries,
  247.                                 IN  PSECURITY_DESCRIPTOR pSD);
  248.  
  249. #ifdef UNICODE
  250.     #define LookupSecurityDescriptorParts       LookupSecurityDescriptorPartsW
  251. #else
  252.     #define LookupSecurityDescriptorParts       LookupSecurityDescriptorPartsA
  253. #endif
  254.  
  255.  
  256. //----------------------------------------------------------------------------
  257. // The following helper API are provided for building
  258. // access control structures.
  259. //----------------------------------------------------------------------------
  260.  
  261. VOID
  262. WINAPI
  263. BuildExplicitAccessWithNameW( IN OUT PEXPLICIT_ACCESS_W  pExplicitAccess,
  264.                               IN     LPWSTR              pTrusteeName,
  265.                               IN     DWORD               AccessPermissions,
  266.                               IN     ACCESS_MODE         AccessMode,
  267.                               IN     DWORD               Inheritance);
  268.  
  269. VOID
  270. WINAPI
  271. BuildExplicitAccessWithNameA( IN OUT PEXPLICIT_ACCESS_A  pExplicitAccess,
  272.                               IN     LPSTR               pTrusteeName,
  273.                               IN     DWORD               AccessPermissions,
  274.                               IN     ACCESS_MODE         AccessMode,
  275.                               IN     DWORD               Inheritance);
  276.  
  277. #ifdef UNICODE
  278.     #define BuildExplicitAccessWithName     BuildExplicitAccessWithNameW
  279. #else
  280.     #define BuildExplicitAccessWithName     BuildExplicitAccessWithNameA
  281. #endif
  282.  
  283.  
  284. VOID
  285. WINAPI
  286. BuildImpersonateExplicitAccessWithNameW(
  287.     IN OUT PEXPLICIT_ACCESS_W  pExplicitAccess,
  288.     IN     LPWSTR              pTrusteeName,
  289.     IN     PTRUSTEE_W          pTrustee,
  290.     IN     DWORD               AccessPermissions,
  291.     IN     ACCESS_MODE         AccessMode,
  292.     IN     DWORD               Inheritance);
  293.  
  294. VOID
  295. WINAPI
  296. BuildImpersonateExplicitAccessWithNameA(
  297.     IN OUT PEXPLICIT_ACCESS_A  pExplicitAccess,
  298.     IN     LPSTR               pTrusteeName,
  299.     IN     PTRUSTEE_A          pTrustee,
  300.     IN     DWORD               AccessPermissions,
  301.     IN     ACCESS_MODE         AccessMode,
  302.     IN     DWORD               Inheritance);
  303.  
  304. #ifdef UNICODE
  305.     #define BuildImpersonateExplicitAccessWithName BuildImpersonateExplicitAccessWithNameW
  306. #else
  307.     #define BuildImpersonateExplicitAccessWithName BuildImpersonateExplicitAccessWithNameA
  308. #endif
  309.  
  310.  
  311. VOID
  312. WINAPI
  313. BuildTrusteeWithNameW( IN OUT PTRUSTEE_W  pTrustee,
  314.                        IN     LPWSTR      pName);
  315.  
  316. VOID
  317. WINAPI
  318. BuildTrusteeWithNameA( IN OUT PTRUSTEE_A  pTrustee,
  319.                        IN     LPSTR       pName);
  320.  
  321. #ifdef UNICODE
  322.     #define BuildTrusteeWithName        BuildTrusteeWithNameW
  323. #else
  324.     #define BuildTrusteeWithName        BuildTrusteeWithNameA
  325. #endif
  326.  
  327.  
  328. VOID
  329. WINAPI
  330. BuildImpersonateTrusteeW( IN OUT PTRUSTEE_W  pTrustee,
  331.                           IN     PTRUSTEE_W  pImpersonateTrustee);
  332.  
  333. VOID
  334. WINAPI
  335. BuildImpersonateTrusteeA( IN OUT PTRUSTEE_A  pTrustee,
  336.                           IN     PTRUSTEE_A  pImpersonateTrustee);
  337.  
  338. #ifdef UNICODE
  339.     #define BuildImpersonateTrustee     BuildImpersonateTrusteeW
  340. #else
  341.     #define BuildImpersonateTrustee     BuildImpersonateTrusteeA
  342. #endif
  343.  
  344.  
  345. VOID
  346. WINAPI
  347. BuildTrusteeWithSidW( IN OUT PTRUSTEE_W  pTrustee,
  348.                       IN     PSID        pSid);
  349.  
  350. VOID
  351. WINAPI
  352. BuildTrusteeWithSidA( IN OUT PTRUSTEE_A  pTrustee,
  353.                       IN     PSID        pSid);
  354.  
  355. #ifdef UNICODE
  356.     #define BuildTrusteeWithSid     BuildTrusteeWithSidW
  357. #else
  358.     #define BuildTrusteeWithSid     BuildTrusteeWithSidA
  359. #endif
  360.  
  361.  
  362. LPWSTR
  363. WINAPI
  364. GetTrusteeNameW( IN PTRUSTEE_W  pTrustee);
  365.  
  366. LPSTR
  367. WINAPI
  368. GetTrusteeNameA( IN PTRUSTEE_A  pTrustee);
  369.  
  370. #ifdef UNICODE
  371.     #define GetTrusteeName     GetTrusteeNameW
  372. #else
  373.     #define GetTrusteeName     GetTrusteeNameA
  374. #endif
  375.  
  376.  
  377. TRUSTEE_TYPE
  378. WINAPI
  379. GetTrusteeTypeW( IN PTRUSTEE_W  pTrustee);
  380.  
  381. TRUSTEE_TYPE
  382. WINAPI
  383. GetTrusteeTypeA( IN PTRUSTEE_A  pTrustee);
  384.  
  385. #ifdef UNICODE
  386.     #define GetTrusteeType     GetTrusteeTypeW
  387. #else
  388.     #define GetTrusteeType     GetTrusteeTypeA
  389. #endif
  390.  
  391.  
  392. TRUSTEE_FORM
  393. WINAPI
  394. GetTrusteeFormW( IN PTRUSTEE_W  pTrustee);
  395.  
  396. TRUSTEE_FORM
  397. WINAPI
  398. GetTrusteeFormA( IN PTRUSTEE_A  pTrustee);
  399.  
  400. #ifdef UNICODE
  401.     #define GetTrusteeForm     GetTrusteeFormW
  402. #else
  403.     #define GetTrusteeForm     GetTrusteeFormA
  404. #endif
  405.  
  406.  
  407. MULTIPLE_TRUSTEE_OPERATION
  408. WINAPI
  409. GetMultipleTrusteeOperationW( IN PTRUSTEE_W  pTrustee);
  410.  
  411. MULTIPLE_TRUSTEE_OPERATION
  412. WINAPI
  413. GetMultipleTrusteeOperationA( IN PTRUSTEE_A  pTrustee);
  414.  
  415. #ifdef UNICODE
  416.     #define GetMultipleTrusteeOperation        GetMultipleTrusteeOperationW
  417. #else
  418.     #define GetMultipleTrusteeOperation        GetMultipleTrusteeOperationA
  419. #endif
  420.  
  421.  
  422. PTRUSTEE_W
  423. WINAPI
  424. GetMultipleTrusteeW( IN PTRUSTEE_W  pTrustee);
  425.  
  426. PTRUSTEE_A
  427. WINAPI
  428. GetMultipleTrusteeA( IN PTRUSTEE_A  pTrustee);
  429.  
  430. #ifdef UNICODE
  431.     #define GetMultipleTrustee     GetMultipleTrusteeW
  432. #else
  433.     #define GetMultipleTrustee     GetMultipleTrusteeA
  434. #endif
  435.  
  436.  
  437. #ifdef __cplusplus
  438. }
  439. #endif
  440.  
  441. #pragma option pop
  442. #endif // __ACCESS_CONTROL_API__
  443.